.TH "comm_can.h" 3 "Wed Sep 16 2015" "Doxygen" \" -*- nroff -*-
.ad l
.nh
.SH NAME
comm_can.h \- 
.SH SYNOPSIS
.br
.PP
\fC#include 'conf_general\&.h'\fP
.br

.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBCAN_STATUS_MSG_INT_MS\fP   1"
.br
.ti -1c
.RI "#define \fBCAN_STATUS_MSGS_TO_STORE\fP   10"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBcomm_can_init\fP (void)"
.br
.ti -1c
.RI "void \fBcomm_can_transmit\fP (uint32_t id, uint8_t *data, uint8_t len)"
.br
.ti -1c
.RI "void \fBcomm_can_send_buffer\fP (uint8_t controller_id, uint8_t *data, unsigned int len, bool send)"
.br
.ti -1c
.RI "void \fBcomm_can_set_duty\fP (uint8_t controller_id, float duty)"
.br
.ti -1c
.RI "void \fBcomm_can_set_current\fP (uint8_t controller_id, float current)"
.br
.ti -1c
.RI "void \fBcomm_can_set_current_brake\fP (uint8_t controller_id, float current)"
.br
.ti -1c
.RI "void \fBcomm_can_set_rpm\fP (uint8_t controller_id, float rpm)"
.br
.ti -1c
.RI "void \fBcomm_can_set_pos\fP (uint8_t controller_id, float pos)"
.br
.ti -1c
.RI "\fBcan_status_msg\fP * \fBcomm_can_get_status_msg_index\fP (int index)"
.br
.ti -1c
.RI "\fBcan_status_msg\fP * \fBcomm_can_get_status_msg_id\fP (int id)"
.br
.in -1c
.SH "Macro Definition Documentation"
.PP 
.SS "#define CAN_STATUS_MSG_INT_MS   1"

.SS "#define CAN_STATUS_MSGS_TO_STORE   10"

.SH "Function Documentation"
.PP 
.SS "\fBcan_status_msg\fP* comm_can_get_status_msg_id (int id)"
Get status message by id\&.
.PP
\fBParameters:\fP
.RS 4
\fIid\fP Id of the controller that sent the status message\&.
.RE
.PP
\fBReturns:\fP
.RS 4
The message or 0 for an invalid id\&. 
.RE
.PP

.SS "\fBcan_status_msg\fP* comm_can_get_status_msg_index (int index)"
Get status message by index\&.
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index in the array
.RE
.PP
\fBReturns:\fP
.RS 4
The message or 0 for an invalid index\&. 
.RE
.PP

.SS "void comm_can_init (void)"

.SS "void comm_can_send_buffer (uint8_t controller_id, uint8_t * data, unsigned int len, bool send)"
Send a buffer up to RX_BUFFER_SIZE bytes as fragments\&. If the buffer is 6 bytes or less it will be sent in a single CAN frame, otherwise it will be split into several frames\&.
.PP
\fBParameters:\fP
.RS 4
\fIcontroller_id\fP The controller id to send to\&.
.br
\fIdata\fP The payload\&.
.br
\fIlen\fP The payload length\&.
.br
\fIsend\fP If true, this packet will be passed to the send function of commands\&. Otherwise, it will be passed to the process function\&. 
.RE
.PP

.SS "void comm_can_set_current (uint8_t controller_id, float current)"

.SS "void comm_can_set_current_brake (uint8_t controller_id, float current)"

.SS "void comm_can_set_duty (uint8_t controller_id, float duty)"

.SS "void comm_can_set_pos (uint8_t controller_id, float pos)"

.SS "void comm_can_set_rpm (uint8_t controller_id, float rpm)"

.SS "void comm_can_transmit (uint32_t id, uint8_t * data, uint8_t len)"

.SH "Author"
.PP 
Generated automatically by Doxygen from the source code\&.
